﻿using BootstrapBlazor.Components;
using BootstrapBlazorApp.Shared.Data.SYS.Base;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BootstrapBlazorApp.Shared.Data.SYS
{
    public class MenuDto : BaseDto
    {

        [Display(Name = "应用编号")]
        [Required(ErrorMessage = "应用编号是必填的"), MaxLength(50)]
        [AutoGenerateColumn(Searchable = true, Order = 30)]
        public string AppCode { get; set; }

        [Display(Name = "菜单编码")]
        [AutoGenerateColumn(IsReadonlyWhenEdit = true,  Order = 10)]
        [Required(ErrorMessage = "菜单编码是必填的"), MaxLength(50)]
        public string MenuCode { get; set; }

        [Display(Name = "菜单名称")]
        [AutoGenerateColumn( Searchable = true, Order = 20)]
        [Required(ErrorMessage = "菜单名称是必填的"), MaxLength(50)]
        public string Name { get; set; }

        [Display(Name = "图标")]
        [MaxLength(50)]
        [AutoGenerateColumn( Order = 40)]
        public string Icon { get; set; }

        [Display(Name = "菜单类别")]
        [AutoGenerateColumn(Searchable = true, Order = 50)]
        [Required(ErrorMessage = "菜单类别是必填的"), MaxLength(1)]
        public string MenuType { get; set; }


        [Display(Name = "URL", Order = 60)]
        [MaxLength(500)]
        public string? Url { get; set; }

        [Display(Name = "父菜单编码", Order = 70)]
        public string ParentCode { get; set; }
    }
}
